package cn.dansj.bean;

import cn.dansj.common.utils.json.DictMap;
import cn.dansj.common.utils.http.UrlUtils;
import cn.dansj.common.utils.transfer.DefaultMethods;
import cn.dansj.enums.GlobalEnv;

import java.io.Serial;
import java.io.Serializable;

public class NexusRepository extends DefaultMethods implements Serializable {
    @Serial
    private static final long serialVersionUID = GlobalEnv.SerialVersionUID;

    private String name;
    private boolean online;
    private String type;
    private String url;
    private String format;
    private DictMap maven;
    private DictMap proxy;
    private DictMap group;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isOnline() {
        return online;
    }

    public void setOnline(boolean online) {
        this.online = online;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getUrl() {
        return url.replace(GlobalEnv.NexusHost, UrlUtils.getFullHost(GlobalEnv.NexusHost));
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getFormat() {
        return format;
    }

    public void setFormat(String format) {
        this.format = format;
    }

    public DictMap getMaven() {
        return maven;
    }

    public void setMaven(DictMap maven) {
        this.maven = maven;
    }

    public DictMap getProxy() {
        return proxy;
    }

    public void setProxy(DictMap proxy) {
        this.proxy = proxy;
    }

    public DictMap getGroup() {
        return group;
    }

    public void setGroup(DictMap group) {
        this.group = group;
    }
}
